from tkinter_ import *

"""Code Decryption:
"""

root = Tk()
root.title('信息管理系统')

Label(root, text='请输入学生信息').grid(row=0, column=0)

Label(root, text='姓名').grid(row=1, column=0)
student_name = StringVar()
Entry(root, width=30, textvariable=student_name).grid(row=1, column=1, sticky=W)

Label(root, text='ID').grid(row=2, column=0)
student_ID = StringVar()
ID = Entry(root, width=30, textvariable=student_ID).grid(row=2, column=1, sticky=W)

Label(root, text='成绩').grid(row=3, column=0)
student_score = DoubleVar()
Entry(root, width=30, textvariable=student_score).grid(row=3, column=1)

Label(root, text='学生简介').grid(row=4, column=0)
student_of_intro = Text(root, width=30, height=10)
student_of_intro.grid(row=4, column=1)

Label(root, text='验证').grid(row=5, column=0)
judge = BooleanVar()
Checkbutton(root).grid(row=5, column=1, sticky=W)


def enter(name, id_, score) -> object:
    txt_intro = student_of_intro.get('1.0', END)
    print('*' * 50)
    print('姓名:{}'.format(name.get()), end='\t')
    print('ID:{}'.format(id_.get()), end='\t')
    print('分数:{}'.format(score.get()), end='\n')
    print('学生简介:{}'.format(txt_intro))
    print('*' * 50)
    return

Button(root, text='保存', width=12, command=lambda: enter(student_name, student_ID, student_score)).grid(row=6, column=0)
Button(root, text='取消', width=12, command=lambda: root.quit()).grid(row=6, column=1)

root.mainloop()
